{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "20ad85cd",
   "metadata": {},
   "source": [
    "from datetime import datetime \n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59 ]\n",
    "right_this _minute =datetime.roday().mintute\n",
    "if right_this minute in odds:\n",
    "print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "print(\"Not an odd\"minute)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5894d32e",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (3885462854.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [1]\u001b[1;36m\u001b[0m\n\u001b[1;33m    right_this _minute = datetime.today().mintute\u001b[0m\n\u001b[1;37m               ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59 ]\n",
    "right_this _minute = datetime.today().mintute\n",
    "if right_this minute in odds:\n",
    "print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "009ada8e",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (3056529746.py, line 7)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [30]\u001b[1;36m\u001b[0m\n\u001b[1;33m    right_this _minute = datetime.today().mintute\u001b[0m\n\u001b[1;37m               ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55, 57, 59 ]\n",
    "\n",
    "right_this _minute = datetime.today().mintute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "61964c26",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (881710059.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [3]\u001b[1;36m\u001b[0m\n\u001b[1;33m    21, 23, 25, 27, 29, 31, 33, 35, 37, 39\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [  1, 3, 5, 7, 9, 11, 13, 15, 17, 19\n",
    "        21, 23, 25, 27, 29, 31, 33, 35, 37, 39\n",
    "        41, 43, 45, 47, 49, 51, 53, 55, 57, 59  ]\n",
    "\n",
    "right_this _minute = datetime.today().mintute\n",
    "\n",
    "if right_this minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "bb586ea4",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (4071053369.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [4]\u001b[1;36m\u001b[0m\n\u001b[1;33m    21,23,25,27,29,31,33,35,37,39\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this _minute = datetime.today().mintute\n",
    "\n",
    "if right_this minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ab26c70f",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (3653896781.py, line 7)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [5]\u001b[1;36m\u001b[0m\n\u001b[1;33m    right_this _minute = datetime.today().mintute\u001b[0m\n\u001b[1;37m               ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this _minute = datetime.today().mintute\n",
    "\n",
    "if right_this minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "be7a5cd9",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2282198819.py, line 9)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [6]\u001b[1;36m\u001b[0m\n\u001b[1;33m    if right_this minute in odds:\u001b[0m\n\u001b[1;37m                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.today().mintute\n",
    "\n",
    "if right_this minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "a694e2e0",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'datetime.datetime' object has no attribute 'mintute'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Input \u001b[1;32mIn [7]\u001b[0m, in \u001b[0;36m<cell line: 7>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdatetime\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m datetime\n\u001b[0;32m      3\u001b[0m odds \u001b[38;5;241m=\u001b[39m [ \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m7\u001b[39m, \u001b[38;5;241m9\u001b[39m, \u001b[38;5;241m11\u001b[39m, \u001b[38;5;241m13\u001b[39m, \u001b[38;5;241m15\u001b[39m, \u001b[38;5;241m17\u001b[39m, \u001b[38;5;241m19\u001b[39m,\n\u001b[0;32m      4\u001b[0m         \u001b[38;5;241m21\u001b[39m, \u001b[38;5;241m23\u001b[39m, \u001b[38;5;241m25\u001b[39m, \u001b[38;5;241m27\u001b[39m,\u001b[38;5;241m29\u001b[39m, \u001b[38;5;241m31\u001b[39m, \u001b[38;5;241m33\u001b[39m, \u001b[38;5;241m35\u001b[39m, \u001b[38;5;241m37\u001b[39m, \u001b[38;5;241m39\u001b[39m,\n\u001b[0;32m      5\u001b[0m         \u001b[38;5;241m41\u001b[39m, \u001b[38;5;241m43\u001b[39m, \u001b[38;5;241m45\u001b[39m, \u001b[38;5;241m47\u001b[39m, \u001b[38;5;241m49\u001b[39m, \u001b[38;5;241m51\u001b[39m, \u001b[38;5;241m53\u001b[39m, \u001b[38;5;241m55\u001b[39m ,\u001b[38;5;241m57\u001b[39m, \u001b[38;5;241m59\u001b[39m ]\n\u001b[1;32m----> 7\u001b[0m right_this_minute \u001b[38;5;241m=\u001b[39m \u001b[43mdatetime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtoday\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmintute\u001b[49m\n\u001b[0;32m      9\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m right_this_minute \u001b[38;5;129;01min\u001b[39;00m odds:\n\u001b[0;32m     10\u001b[0m      \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis minute seems a little odd.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'datetime.datetime' object has no attribute 'mintute'"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.today().mintute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "527c86da",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "83b4e287",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\class python\\\\python'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fcb2b5af",
   "metadata": {},
   "source": [
    "## 模块\n",
    "> 1.os模块  \n",
    "> 2.datetime模块    \n",
    "> 3.sys模块  \n",
    "\n",
    "\n",
    "# 认识time模块\n",
    "\n",
    "\n",
    "\n",
    "# 2.模块——标准库\n",
    "\n",
    " 标准库是python开发团队为满足python用户日常需求而写好的一些模块，可以直接使用： import 模块名称  \n",
    " \n",
    " # 2.2模块——开源模块（pypi.org）\n",
    " # 2.3自定义模块  \n",
    " \n",
    " \n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "7dc31924",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "192bb48b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=14, tm_min=29, tm_sec=37, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "da6fcc3f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1661841019.1142368"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "6f63e377",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(datetime.datetime, datetime.datetime(2022, 8, 30, 14, 58, 51, 48904))"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime,datetime.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "617e2652",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "type object 'datetime.datetime' has no attribute 'datetime'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Input \u001b[1;32mIn [15]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdatetime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdatetime\u001b[49m\u001b[38;5;241m.\u001b[39mtoday()\n",
      "\u001b[1;31mAttributeError\u001b[0m: type object 'datetime.datetime' has no attribute 'datetime'"
     ]
    }
   ],
   "source": [
    "datetime.datetime.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "6c7da2f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(datetime.datetime, 78895)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime,datetime.today().microsecond"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "7de644de",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (570572717.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [17]\u001b[1;36m\u001b[0m\n\u001b[1;33m    import datetime,datetime.today()\u001b[0m\n\u001b[1;37m                                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import datetime,datetime.today()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "99d4d511",
   "metadata": {},
   "source": [
    "## 3.赋值\n",
    "\n",
    "## 4.变量  \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "2371a8f6",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2282198819.py, line 9)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [19]\u001b[1;36m\u001b[0m\n\u001b[1;33m    if right_this minute in odds:\u001b[0m\n\u001b[1;37m                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.today().mintute\n",
    "\n",
    "if right_this minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "edaa1e65",
   "metadata": {},
   "source": [
    "# 本周学习内容  \n",
    "### 1.Head First Python P4"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "42586bda",
   "metadata": {},
   "source": [
    "按规格书写以下代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "7333c610",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2678291761.py, line 9)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [21]\u001b[1;36m\u001b[0m\n\u001b[1;33m    if right_this minute in odds:\u001b[0m\n\u001b[1;37m                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "# 本项目用到了时间模块\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.datetime.today().mintute\n",
    "\n",
    "if right_this minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4f4a9f7c",
   "metadata": {},
   "source": [
    "datetime.datetime.today().microsecond"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "e47610eb",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2618873247.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [23]\u001b[1;36m\u001b[0m\n\u001b[1;33m    import datetime.datetime.today().microsecond\u001b[0m\n\u001b[1;37m                                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "import datetime.datetime.today().microsecond"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "9f16c0c8",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndentationError",
     "evalue": "unexpected indent (253378991.py, line 13)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [24]\u001b[1;36m\u001b[0m\n\u001b[1;33m    print(datetime.datetime.today().microsecond)\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m unexpected indent\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "# 本项目用到了时间模块\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.datetime.today().mintute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")\n",
    "        print(datetime.datetime.today().microsecond)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "30890807",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'datetime.datetime' object has no attribute 'mintute'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Input \u001b[1;32mIn [25]\u001b[0m, in \u001b[0;36m<cell line: 7>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[38;5;66;03m# 本项目用到了时间模块\u001b[39;00m\n\u001b[0;32m      3\u001b[0m odds \u001b[38;5;241m=\u001b[39m [ \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m7\u001b[39m, \u001b[38;5;241m9\u001b[39m, \u001b[38;5;241m11\u001b[39m, \u001b[38;5;241m13\u001b[39m, \u001b[38;5;241m15\u001b[39m, \u001b[38;5;241m17\u001b[39m, \u001b[38;5;241m19\u001b[39m,\n\u001b[0;32m      4\u001b[0m         \u001b[38;5;241m21\u001b[39m, \u001b[38;5;241m23\u001b[39m, \u001b[38;5;241m25\u001b[39m, \u001b[38;5;241m27\u001b[39m,\u001b[38;5;241m29\u001b[39m, \u001b[38;5;241m31\u001b[39m, \u001b[38;5;241m33\u001b[39m, \u001b[38;5;241m35\u001b[39m, \u001b[38;5;241m37\u001b[39m, \u001b[38;5;241m39\u001b[39m,\n\u001b[0;32m      5\u001b[0m         \u001b[38;5;241m41\u001b[39m, \u001b[38;5;241m43\u001b[39m, \u001b[38;5;241m45\u001b[39m, \u001b[38;5;241m47\u001b[39m, \u001b[38;5;241m49\u001b[39m, \u001b[38;5;241m51\u001b[39m, \u001b[38;5;241m53\u001b[39m, \u001b[38;5;241m55\u001b[39m ,\u001b[38;5;241m57\u001b[39m, \u001b[38;5;241m59\u001b[39m ]\n\u001b[1;32m----> 7\u001b[0m right_this_minute \u001b[38;5;241m=\u001b[39m \u001b[43mdatetime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdatetime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtoday\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmintute\u001b[49m\n\u001b[0;32m      9\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m right_this_minute \u001b[38;5;129;01min\u001b[39;00m odds:\n\u001b[0;32m     10\u001b[0m      \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis minute seems a little odd.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'datetime.datetime' object has no attribute 'mintute'"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "# 本项目用到了时间模块\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.datetime.today().mintute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute\")\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "21f58e33",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "640521\n",
      "Not an odd minute.\n",
      "640521\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "# 本项目用到了时间模块\n",
    "print(datetime.datetime.today().microsecond)\n",
    "\n",
    "odds = [  1, 3,  5,  7,  9, 11,13,15,17,19,\n",
    "             21,23,25,27,29,31,33,35,37,39,\n",
    "             41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_minute = datetime.datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")\n",
    "\n",
    "print(datetime.datetime.today().microsecond)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "6dd5d4ba",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'datetime.datetime' object has no attribute 'mintute'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Input \u001b[1;32mIn [28]\u001b[0m, in \u001b[0;36m<cell line: 7>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mdatetime\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m datetime\n\u001b[0;32m      3\u001b[0m odds \u001b[38;5;241m=\u001b[39m [ \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m7\u001b[39m, \u001b[38;5;241m9\u001b[39m, \u001b[38;5;241m11\u001b[39m, \u001b[38;5;241m13\u001b[39m, \u001b[38;5;241m15\u001b[39m, \u001b[38;5;241m17\u001b[39m, \u001b[38;5;241m19\u001b[39m,\n\u001b[0;32m      4\u001b[0m         \u001b[38;5;241m21\u001b[39m, \u001b[38;5;241m23\u001b[39m, \u001b[38;5;241m25\u001b[39m, \u001b[38;5;241m27\u001b[39m,\u001b[38;5;241m29\u001b[39m, \u001b[38;5;241m31\u001b[39m, \u001b[38;5;241m33\u001b[39m, \u001b[38;5;241m35\u001b[39m, \u001b[38;5;241m37\u001b[39m, \u001b[38;5;241m39\u001b[39m,\n\u001b[0;32m      5\u001b[0m         \u001b[38;5;241m41\u001b[39m, \u001b[38;5;241m43\u001b[39m, \u001b[38;5;241m45\u001b[39m, \u001b[38;5;241m47\u001b[39m, \u001b[38;5;241m49\u001b[39m, \u001b[38;5;241m51\u001b[39m, \u001b[38;5;241m53\u001b[39m, \u001b[38;5;241m55\u001b[39m ,\u001b[38;5;241m57\u001b[39m, \u001b[38;5;241m59\u001b[39m ]\n\u001b[1;32m----> 7\u001b[0m right_this_minute \u001b[38;5;241m=\u001b[39m \u001b[43mdatetime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtoday\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmintute\u001b[49m\n\u001b[0;32m      9\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m right_this_minute \u001b[38;5;129;01min\u001b[39;00m odds:\n\u001b[0;32m     10\u001b[0m      \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis minute seems a little odd.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'datetime.datetime' object has no attribute 'mintute'"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27,29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55 ,57, 59 ]\n",
    "\n",
    "right_this_minute = datetime.today().mintute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "     print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "     print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e4f0cdea",
   "metadata": {},
   "source": [
    "## 2.1模块——标准库\n",
    "   > 标准库是python开发团队为满足python用户日常需求而写好的一些模块，可以直接使用： import 模块名称  \n",
    "    >> 1.sys模块    \n",
    "    >> 2.os模块  \n",
    "    >> 3.datetim模块  \n",
    "    \n",
    "## 2.2模块——开源模块（pypi.org） \n",
    "\n",
    "## 2.3自定义模块\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "598c5ddf",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "d180bfaa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]'"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "11776b07",
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "11e80746",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2022, 8, 30)"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82767875",
   "metadata": {},
   "source": [
    "# 认识time模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "13676f6e",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2088602511.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [37]\u001b[1;36m\u001b[0m\n\u001b[1;33m    impact time\u001b[0m\n\u001b[1;37m           ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "impact time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "1ba98ebe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=16, tm_min=0, tm_sec=55, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "661886fe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1661846469.1369824"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "995ad862",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "52.6968067161256"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()/60/60/24/365"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "10a2f731",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1970"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2022-52"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "ba6a43d9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=8, tm_min=2, tm_sec=2, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.gmtime()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1d0353f1",
   "metadata": {},
   "source": [
    "- [许老师博客](https://www.cnblogs.com/xuzhichao) \n",
    "- [markdown](https://www.markdownguide.org/)  \n",
    "- [许老师gitee](https://gitee.com/xzhichao)\n",
    "- [python文档——文档](https://docs.python.org/3/library/)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abc2051a",
   "metadata": {},
   "outputs": [],
   "source": [
    "今天 = "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "1c2f7d83",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in module time:\n",
      "\n",
      "NAME\n",
      "    time - This module provides various functions to manipulate time values.\n",
      "\n",
      "DESCRIPTION\n",
      "    There are two standard representations of time.  One is the number\n",
      "    of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer\n",
      "    or a floating point number (to represent fractions of seconds).\n",
      "    The Epoch is system-defined; on Unix, it is generally January 1st, 1970.\n",
      "    The actual value can be retrieved by calling gmtime(0).\n",
      "    \n",
      "    The other representation is a tuple of 9 integers giving local time.\n",
      "    The tuple items are:\n",
      "      year (including century, e.g. 1998)\n",
      "      month (1-12)\n",
      "      day (1-31)\n",
      "      hours (0-23)\n",
      "      minutes (0-59)\n",
      "      seconds (0-59)\n",
      "      weekday (0-6, Monday is 0)\n",
      "      Julian day (day in the year, 1-366)\n",
      "      DST (Daylight Savings Time) flag (-1, 0 or 1)\n",
      "    If the DST flag is 0, the time is given in the regular time zone;\n",
      "    if it is 1, the time is given in the DST time zone;\n",
      "    if it is -1, mktime() should guess based on the date and time.\n",
      "\n",
      "CLASSES\n",
      "    builtins.tuple(builtins.object)\n",
      "        struct_time\n",
      "    \n",
      "    class struct_time(builtins.tuple)\n",
      "     |  struct_time(iterable=(), /)\n",
      "     |  \n",
      "     |  The time value as returned by gmtime(), localtime(), and strptime(), and\n",
      "     |  accepted by asctime(), mktime() and strftime().  May be considered as a\n",
      "     |  sequence of 9 integers.\n",
      "     |  \n",
      "     |  Note that several fields' values are not the same as those defined by\n",
      "     |  the C language standard for struct tm.  For example, the value of the\n",
      "     |  field tm_year is the actual year, not year - 1900.  See individual\n",
      "     |  fields' descriptions for details.\n",
      "     |  \n",
      "     |  Method resolution order:\n",
      "     |      struct_time\n",
      "     |      builtins.tuple\n",
      "     |      builtins.object\n",
      "     |  \n",
      "     |  Methods defined here:\n",
      "     |  \n",
      "     |  __reduce__(...)\n",
      "     |      Helper for pickle.\n",
      "     |  \n",
      "     |  __repr__(self, /)\n",
      "     |      Return repr(self).\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Static methods defined here:\n",
      "     |  \n",
      "     |  __new__(*args, **kwargs) from builtins.type\n",
      "     |      Create and return a new object.  See help(type) for accurate signature.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data descriptors defined here:\n",
      "     |  \n",
      "     |  tm_gmtoff\n",
      "     |      offset from UTC in seconds\n",
      "     |  \n",
      "     |  tm_hour\n",
      "     |      hours, range [0, 23]\n",
      "     |  \n",
      "     |  tm_isdst\n",
      "     |      1 if summer time is in effect, 0 if not, and -1 if unknown\n",
      "     |  \n",
      "     |  tm_mday\n",
      "     |      day of month, range [1, 31]\n",
      "     |  \n",
      "     |  tm_min\n",
      "     |      minutes, range [0, 59]\n",
      "     |  \n",
      "     |  tm_mon\n",
      "     |      month of year, range [1, 12]\n",
      "     |  \n",
      "     |  tm_sec\n",
      "     |      seconds, range [0, 61])\n",
      "     |  \n",
      "     |  tm_wday\n",
      "     |      day of week, range [0, 6], Monday is 0\n",
      "     |  \n",
      "     |  tm_yday\n",
      "     |      day of year, range [1, 366]\n",
      "     |  \n",
      "     |  tm_year\n",
      "     |      year, for example, 1993\n",
      "     |  \n",
      "     |  tm_zone\n",
      "     |      abbreviation of timezone name\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Data and other attributes defined here:\n",
      "     |  \n",
      "     |  n_fields = 11\n",
      "     |  \n",
      "     |  n_sequence_fields = 9\n",
      "     |  \n",
      "     |  n_unnamed_fields = 0\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __add__(self, value, /)\n",
      "     |      Return self+value.\n",
      "     |  \n",
      "     |  __contains__(self, key, /)\n",
      "     |      Return key in self.\n",
      "     |  \n",
      "     |  __eq__(self, value, /)\n",
      "     |      Return self==value.\n",
      "     |  \n",
      "     |  __ge__(self, value, /)\n",
      "     |      Return self>=value.\n",
      "     |  \n",
      "     |  __getattribute__(self, name, /)\n",
      "     |      Return getattr(self, name).\n",
      "     |  \n",
      "     |  __getitem__(self, key, /)\n",
      "     |      Return self[key].\n",
      "     |  \n",
      "     |  __getnewargs__(self, /)\n",
      "     |  \n",
      "     |  __gt__(self, value, /)\n",
      "     |      Return self>value.\n",
      "     |  \n",
      "     |  __hash__(self, /)\n",
      "     |      Return hash(self).\n",
      "     |  \n",
      "     |  __iter__(self, /)\n",
      "     |      Implement iter(self).\n",
      "     |  \n",
      "     |  __le__(self, value, /)\n",
      "     |      Return self<=value.\n",
      "     |  \n",
      "     |  __len__(self, /)\n",
      "     |      Return len(self).\n",
      "     |  \n",
      "     |  __lt__(self, value, /)\n",
      "     |      Return self<value.\n",
      "     |  \n",
      "     |  __mul__(self, value, /)\n",
      "     |      Return self*value.\n",
      "     |  \n",
      "     |  __ne__(self, value, /)\n",
      "     |      Return self!=value.\n",
      "     |  \n",
      "     |  __rmul__(self, value, /)\n",
      "     |      Return value*self.\n",
      "     |  \n",
      "     |  count(self, value, /)\n",
      "     |      Return number of occurrences of value.\n",
      "     |  \n",
      "     |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      "     |      Return first index of value.\n",
      "     |      \n",
      "     |      Raises ValueError if the value is not present.\n",
      "     |  \n",
      "     |  ----------------------------------------------------------------------\n",
      "     |  Class methods inherited from builtins.tuple:\n",
      "     |  \n",
      "     |  __class_getitem__(...) from builtins.type\n",
      "     |      See PEP 585\n",
      "\n",
      "FUNCTIONS\n",
      "    asctime(...)\n",
      "        asctime([tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.\n",
      "        When the time tuple is not present, current time as returned by localtime()\n",
      "        is used.\n",
      "    \n",
      "    ctime(...)\n",
      "        ctime(seconds) -> string\n",
      "        \n",
      "        Convert a time in seconds since the Epoch to a string in local time.\n",
      "        This is equivalent to asctime(localtime(seconds)). When the time tuple is\n",
      "        not present, current time as returned by localtime() is used.\n",
      "    \n",
      "    get_clock_info(...)\n",
      "        get_clock_info(name: str) -> dict\n",
      "        \n",
      "        Get information of the specified clock.\n",
      "    \n",
      "    gmtime(...)\n",
      "        gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,\n",
      "                               tm_sec, tm_wday, tm_yday, tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.\n",
      "        GMT).  When 'seconds' is not passed in, convert the current time instead.\n",
      "        \n",
      "        If the platform supports the tm_gmtoff and tm_zone, they are available as\n",
      "        attributes only.\n",
      "    \n",
      "    localtime(...)\n",
      "        localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,\n",
      "                                  tm_sec,tm_wday,tm_yday,tm_isdst)\n",
      "        \n",
      "        Convert seconds since the Epoch to a time tuple expressing local time.\n",
      "        When 'seconds' is not passed in, convert the current time instead.\n",
      "    \n",
      "    mktime(...)\n",
      "        mktime(tuple) -> floating point number\n",
      "        \n",
      "        Convert a time tuple in local time to seconds since the Epoch.\n",
      "        Note that mktime(gmtime(0)) will not generally return zero for most\n",
      "        time zones; instead the returned value will either be equal to that\n",
      "        of the timezone or altzone attributes on the time module.\n",
      "    \n",
      "    monotonic(...)\n",
      "        monotonic() -> float\n",
      "        \n",
      "        Monotonic clock, cannot go backward.\n",
      "    \n",
      "    monotonic_ns(...)\n",
      "        monotonic_ns() -> int\n",
      "        \n",
      "        Monotonic clock, cannot go backward, as nanoseconds.\n",
      "    \n",
      "    perf_counter(...)\n",
      "        perf_counter() -> float\n",
      "        \n",
      "        Performance counter for benchmarking.\n",
      "    \n",
      "    perf_counter_ns(...)\n",
      "        perf_counter_ns() -> int\n",
      "        \n",
      "        Performance counter for benchmarking as nanoseconds.\n",
      "    \n",
      "    process_time(...)\n",
      "        process_time() -> float\n",
      "        \n",
      "        Process time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    process_time_ns(...)\n",
      "        process_time() -> int\n",
      "        \n",
      "        Process time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    sleep(...)\n",
      "        sleep(seconds)\n",
      "        \n",
      "        Delay execution for a given number of seconds.  The argument may be\n",
      "        a floating point number for subsecond precision.\n",
      "    \n",
      "    strftime(...)\n",
      "        strftime(format[, tuple]) -> string\n",
      "        \n",
      "        Convert a time tuple to a string according to a format specification.\n",
      "        See the library reference manual for formatting codes. When the time tuple\n",
      "        is not present, current time as returned by localtime() is used.\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    strptime(...)\n",
      "        strptime(string, format) -> struct_time\n",
      "        \n",
      "        Parse a string to a time tuple according to a format specification.\n",
      "        See the library reference manual for formatting codes (same as\n",
      "        strftime()).\n",
      "        \n",
      "        Commonly used format codes:\n",
      "        \n",
      "        %Y  Year with century as a decimal number.\n",
      "        %m  Month as a decimal number [01,12].\n",
      "        %d  Day of the month as a decimal number [01,31].\n",
      "        %H  Hour (24-hour clock) as a decimal number [00,23].\n",
      "        %M  Minute as a decimal number [00,59].\n",
      "        %S  Second as a decimal number [00,61].\n",
      "        %z  Time zone offset from UTC.\n",
      "        %a  Locale's abbreviated weekday name.\n",
      "        %A  Locale's full weekday name.\n",
      "        %b  Locale's abbreviated month name.\n",
      "        %B  Locale's full month name.\n",
      "        %c  Locale's appropriate date and time representation.\n",
      "        %I  Hour (12-hour clock) as a decimal number [01,12].\n",
      "        %p  Locale's equivalent of either AM or PM.\n",
      "        \n",
      "        Other codes may be available on your platform.  See documentation for\n",
      "        the C library strftime function.\n",
      "    \n",
      "    thread_time(...)\n",
      "        thread_time() -> float\n",
      "        \n",
      "        Thread time for profiling: sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    thread_time_ns(...)\n",
      "        thread_time() -> int\n",
      "        \n",
      "        Thread time for profiling as nanoseconds:\n",
      "        sum of the kernel and user-space CPU time.\n",
      "    \n",
      "    time(...)\n",
      "        time() -> floating point number\n",
      "        \n",
      "        Return the current time in seconds since the Epoch.\n",
      "        Fractions of a second may be present if the system clock provides them.\n",
      "    \n",
      "    time_ns(...)\n",
      "        time_ns() -> int\n",
      "        \n",
      "        Return the current time in nanoseconds since the Epoch.\n",
      "\n",
      "DATA\n",
      "    altzone = -32400\n",
      "    daylight = 0\n",
      "    timezone = -28800\n",
      "    tzname = ('中国标准时间', '中国夏令时')\n",
      "\n",
      "FILE\n",
      "    (built-in)\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "2289c2fb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "5183d849",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime().tm_mday"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "a3182952",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (1034568922.py, line 4)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [47]\u001b[1;36m\u001b[0m\n\u001b[1;33m    else:\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "今天 = time.localtime().tm_mday\n",
    "if 今天 == 1:\n",
    "    print(\"今天有python课，时间为：下午2.30-4.50\")\n",
    "    else:\n",
    "        print(\"今天没有python课，哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "572688e7",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "9a666c8e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=30, tm_hour=16, tm_min=42, tm_sec=30, tm_wday=1, tm_yday=242, tm_isdst=0)"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "06bee324",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime().tm_wday"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "f3472f0f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "今天有python课，时间为2.30-16.50\n"
     ]
    }
   ],
   "source": [
    "今天 = time.localtime().tm_wday\n",
    "\n",
    "if 今天 == 1:\n",
    "    print(\"今天有python课，时间为2.30-16.50\")\n",
    "else:\n",
    "    print(\"今天没有python课\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0622fc44",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
